package com.xiaojf.xlog.appender.console;

import cn.hutool.json.JSONUtil;
import com.xiaojf.xlog.appender.AccessLogAppender;
import com.xiaojf.xlog.model.XlogAccessLog;

/**
 * 控制台打印访问日志
 *
 * @author Ade.Xiao 2021/3/11 14:35
 */
public class AccessLogConsoleAppender implements AccessLogAppender {

    public AccessLogConsoleAppender() {
        System.out.println("使用console记录访问日志...");
    }

    @Override
    public void record(XlogAccessLog log) {
        System.out.println(JSONUtil.toJsonStr(log));
    }
}